/*    */ package com.zimbra.cs.account.ldap.upgrade;
/*    */ 
/*    */ import com.zimbra.common.service.ServiceException;
/*    */ import com.zimbra.cs.account.Cos;
/*    */ import com.zimbra.cs.account.Entry.EntryType;
/*    */ import com.zimbra.cs.account.ldap.LdapProv;
/*    */ import com.zimbra.cs.ldap.LdapClient;
/*    */ import com.zimbra.cs.ldap.LdapServerType;
/*    */ import com.zimbra.cs.ldap.LdapUsage;
/*    */ import com.zimbra.cs.ldap.ZLdapContext;
/*    */ import java.util.HashMap;
/*    */ import java.util.List;
/*    */ import java.util.Map;
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ public class BUG_88766
/*    */   extends UpgradeOp
/*    */ {
/*    */   private static final String ATTR_NAME = "zimbraPrefHtmlEditorDefaultFontFamily";
/*    */   private static final String FROM_VALUE = "times new roman, new york, times, serif";
/*    */   private static final String TO_VALUE = "arial, helvetica, sans-serif";
/*    */   
/*    */   void doUpgrade()
/*    */     throws ServiceException
/*    */   {
/* 40 */     ZLdapContext zlc = LdapClient.getContext(LdapServerType.MASTER, LdapUsage.UPGRADE);
/*    */     try {
/* 42 */       doCos(zlc);
/*    */     } finally {
/* 44 */       LdapClient.closeContext(zlc);
/*    */     }
/*    */   }
/*    */   
/*    */   Description getDescription()
/*    */   {
/* 50 */     return new Description(this, new String[] { "zimbraPrefHtmlEditorDefaultFontFamily" }, new Entry.EntryType[] { Entry.EntryType.COS }, "times new roman, new york, times, serif", "arial, helvetica, sans-serif", "Update html editor fonts to 8.5 default for all COSes where it is set to the previous default");
/*    */   }
/*    */   
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */   private void doCos(ZLdapContext zlc)
/*    */     throws ServiceException
/*    */   {
/* 60 */     List<Cos> classes = this.prov.getAllCos();
/* 61 */     if (classes != null) {
/* 62 */       for (Cos cos : classes) {
/* 63 */         String fonts = cos.getAttr("zimbraPrefHtmlEditorDefaultFontFamily", "");
/* 64 */         if ("times new roman, new york, times, serif".equalsIgnoreCase(fonts)) {
/* 65 */           Map<String, Object> attrs = new HashMap();
/* 66 */           attrs.put("zimbraPrefHtmlEditorDefaultFontFamily", "arial, helvetica, sans-serif");
/* 67 */           modifyAttrs(cos, attrs);
/*    */         }
/*    */       }
/*    */     }
/*    */   }
/*    */ }


/* Location:              /home/mint/zimbrastore.jar!/com/zimbra/cs/account/ldap/upgrade/BUG_88766.class
 * Java compiler version: 7 (51.0)
 * JD-Core Version:       0.7.1
 */